/*     */ package com.zimbra.cs.lmtpserver;
/*     */ 
/*     */ import com.google.common.collect.ArrayListMultimap;
/*     */ import com.google.common.collect.Multimap;
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import java.util.LinkedList;
/*     */ import java.util.List;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class LmtpEnvelope
/*     */ {
/*     */   private List<LmtpAddress> mRecipients;
/*     */   private List<LmtpAddress> mLocalRecipients;
/*     */   private List<LmtpAddress> mRemoteRecipients;
/*     */   private Multimap<String, LmtpAddress> mRemoteServerToRecipientsMap;
/*     */   private LmtpAddress mSender;
/*     */   private int mSize;
/*     */   private LmtpBodyType mBodyType;
/*     */   
/*     */   public LmtpEnvelope()
/*     */   {
/*  46 */     this.mRecipients = new LinkedList();
/*  47 */     this.mLocalRecipients = new LinkedList();
/*  48 */     this.mRemoteRecipients = new LinkedList();
/*  49 */     this.mRemoteServerToRecipientsMap = ArrayListMultimap.create();
/*     */   }
/*     */   
/*     */   public boolean hasSender() {
/*  53 */     return this.mSender != null;
/*     */   }
/*     */   
/*     */   public boolean hasRecipients() {
/*  57 */     return this.mRecipients.size() > 0;
/*     */   }
/*     */   
/*     */   public void setSender(LmtpAddress sender) {
/*  61 */     this.mSender = sender;
/*     */   }
/*     */   
/*     */   public void addLocalRecipient(LmtpAddress recipient) {
/*  65 */     this.mRecipients.add(recipient);
/*  66 */     this.mLocalRecipients.add(recipient);
/*     */   }
/*     */   
/*     */   public void addRemoteRecipient(LmtpAddress recipient) {
/*  70 */     if (recipient.getRemoteServer() == null) {
/*  71 */       ZimbraLog.lmtp.error("Server for remote recipient %s has not been set", new Object[] { recipient });
/*  72 */       return;
/*     */     }
/*  74 */     this.mRecipients.add(recipient);
/*  75 */     this.mRemoteRecipients.add(recipient);
/*  76 */     this.mRemoteServerToRecipientsMap.put(recipient.getRemoteServer(), recipient);
/*     */   }
/*     */   
/*     */   public List<LmtpAddress> getRecipients() {
/*  80 */     return this.mRecipients;
/*     */   }
/*     */   
/*     */   public List<LmtpAddress> getLocalRecipients() {
/*  84 */     return this.mLocalRecipients;
/*     */   }
/*     */   
/*     */   public List<LmtpAddress> getRemoteRecipients() {
/*  88 */     return this.mRemoteRecipients;
/*     */   }
/*     */   
/*     */   public Multimap<String, LmtpAddress> getRemoteServerToRecipientsMap() {
/*  92 */     return this.mRemoteServerToRecipientsMap;
/*     */   }
/*     */   
/*     */   public LmtpAddress getSender() {
/*  96 */     return this.mSender;
/*     */   }
/*     */   
/*     */   public LmtpBodyType getBodyType() {
/* 100 */     return this.mBodyType;
/*     */   }
/*     */   
/*     */   public void setBodyType(LmtpBodyType bodyType) {
/* 104 */     this.mBodyType = bodyType;
/*     */   }
/*     */   
/*     */   public int getSize() {
/* 108 */     return this.mSize;
/*     */   }
/*     */   
/*     */   public void setSize(int size) {
/* 112 */     this.mSize = size;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/lmtpserver/LmtpEnvelope.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */